using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TestSystem.BLL;
using TestSystem.BLL.TestSystem;


public partial class Subjects : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            List<Subject> subjects = Subject.GetAll(Utils.IsAdmin);
            int count = subjects.Count;
            int cnt = count%2 == 0 ? count/2 : (count/2) + 1;
            dlSubjects1.DataSource = subjects.GetRange(0, cnt);
            dlSubjects2.DataSource = subjects.GetRange(cnt, count - cnt);
            dlSubjects1.DataBind();
            dlSubjects2.DataBind();
        }
    }
}
